package rsj.api.product.export.test;

import com.rlyy.aibase.utils.base.Box;
import com.rlyy.aibase.utils.base.MapNode;
import common.util.BoxUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import rsj.api.org.entity.UsageReportParam;
import rsj.api.user.BaseLink;
import rsj.service.export.IExportTemplateMethod;
import common.util.validator.ParameterConversionCheck;

/**
 * 产品管理-导出测试环境当前表格
 *
 * @author yuanqinglong
 * @since 2021/3/5 9:23
 */
//@RestController
public class ProductTestCurrentTableExportController extends BaseLink {

    @Autowired
    private IExportTemplateMethod productTestCurrentTable;

    /**
     * 导出生产环境当前表格
     *
     * @param box 参数
     * @return 详情
     */
    @Override
    @RequestMapping(value = "rsj_product_test_current_table_export")
    public Box executeLink(Box box) {
        UsageReportParam dataEntity = (UsageReportParam) ParameterConversionCheck.parameterConversionCheckFastFail(box, UsageReportParam.class, UsageReportParam.ProdUidNotNull.class);
        MapNode mapNode = productTestCurrentTable.performExport(dataEntity, productTestCurrentTable);
        return BoxUtil.successBox(box).putMapNode("data", mapNode);
    }


}
